<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>tput</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_001_014_2315">&nbsp;</a>NAME</h4><blockquote>
tput - change terminal characteristics
</blockquote><h4><a name = "tag_001_014_2316">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

tput <b>[</b>-T <i>type</i><b>] </b><i>operand</i>...
</code>
</pre>
</blockquote><h4><a name = "tag_001_014_2317">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>tput</i>
utility displays terminal-dependent information.
The manner in which this information is retrieved is unspecified.
The information displayed will clear the terminal screen,
initialise the user's terminal or reset the user's terminal,
depending on the operand given.
The exact consequences of displaying this information are unspecified.
</blockquote><h4><a name = "tag_001_014_2318">&nbsp;</a>OPTIONS</h4><blockquote>
The
<i>tput</i>
utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> .
<p>
The following option is supported:
<dl compact>

<dt><b>-T&nbsp;</b><i>type</i>
<dd>Indicate the type of terminal.
If this option is not supplied and the
<i>TERM</i>
variable is unset or null,
an unspecified default terminal type will be used.
The setting of
<i>type</i>
will take precedence over the value in
<i>TERM .
</i>
</dl>
</blockquote><h4><a name = "tag_001_014_2319">&nbsp;</a>OPERANDS</h4><blockquote>
The following strings will be supported as operands by the implementation
in the POSIX locale:
<dl compact>

<dt><b>clear</b><dd>Display the clear-screen sequence.

<dt><b>init</b><dd>Display the sequence that will initialise
the user's terminal in an implementation-dependent manner.

<dt><b>reset</b><dd>Display the sequence that will reset
the user's terminal in an implementation-dependent manner.

</dl>
<p>
If a terminal does not support any of the operations
described by these operands, this will not be considered
an error condition.
</blockquote><h4><a name = "tag_001_014_2320">&nbsp;</a>STDIN</h4><blockquote>
Not used.
</blockquote><h4><a name = "tag_001_014_2321">&nbsp;</a>INPUT FILES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2322">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>
The following environment variables affect the execution of
<i>tput</i>:
<dl compact>

<dt><i>LANG</i><dd>Provide a default value for the internationalisation variables
that are unset or null.
If
<i>LANG</i>
is unset or null, the corresponding value from the
implementation-dependent default locale will be used.
If any of the internationalisation variables contains an invalid setting, the
utility will behave as if none of the variables had been defined.

<dt><i>LC_ALL</i><dd>
If set to a non-empty string value,
override the values of all the other internationalisation variables.

<dt><i>LC_CTYPE</i><dd>
Determine the
locale for the interpretation of sequences of bytes of text data as
characters (for example, single- as opposed to multi-byte characters
in arguments).

<dt><i>LC_MESSAGES</i><dd>
Determine the locale that should be used to affect
the format and contents of diagnostic
messages written to standard error.

<dt><i>NLSPATH</i><dd>
Determine the location of message catalogues
for the processing of
<i>LC_MESSAGES .
</i>
<dt><i>TERM</i><dd>Determine the terminal type.
If this variable is
unset or null,
and if the
<b>-T</b>
option is not specified, an unspecified default
terminal type will be used.

</dl>
</blockquote><h4><a name = "tag_001_014_2323">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_2324">&nbsp;</a>STDOUT</h4><blockquote>
If standard output is a terminal device,
it may be used for writing
the appropriate sequence to clear the screen or reset or initialise
the terminal.
If standard output is not a terminal device,
undefined results occur.
</blockquote><h4><a name = "tag_001_014_2325">&nbsp;</a>STDERR</h4><blockquote>
Used only for diagnostic messages.
</blockquote><h4><a name = "tag_001_014_2326">&nbsp;</a>OUTPUT FILES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2327">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2328">&nbsp;</a>EXIT STATUS</h4><blockquote>
The following exit values are returned:
<dl compact>

<dt>0<dd>The requested string was written successfully.

<dt>1<dd>Unspecified.

<dt>2<dd>Usage error.

<dt>3<dd>No information is available about the specified terminal type.

<dt>4<dd>The specified operand is invalid.

<dt>&gt;4<dd>An error occurred.

</dl>
</blockquote><h4><a name = "tag_001_014_2329">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>
If one of the operands is not available for the terminal,
<i>tput</i>
continues processing the remaining operands.
</blockquote><h4><a name = "tag_001_014_2330">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
The difference between resetting and initialising a terminal
is left unspecified, as they vary greatly based on hardware types.
In general, resetting is a more severe action.
<p>
Some terminals use control characters to perform the
stated functions, and on such terminals it might make
sense to use
<i>tput</i>
to store the initialisation strings in a file
or environment variable for later use.
However, because other terminals might rely on
system calls to do this work, the standard output
cannot be used in a portable manner,
such as the following non-portable constructs:
<pre>
<code>
ClearVar=`tput clear`
tput reset | mailx -s "Wake Up" ddg
</code>
</pre>
</blockquote><h4><a name = "tag_001_014_2331">&nbsp;</a>EXAMPLES</h4><blockquote>
<ol>
<p>
<li>
Initialise the terminal according to the type of terminal
in the environmental variable
<i>TERM</i>.
This command can be included in a
<b>.profile</b>
file.
<pre>
<code>
tput init
</code>
</pre>
<p>
<li>
Reset a 450 terminal.
<pre>
<code>
tput -T 450 reset
</code>
</pre>
<p>
</ol>
</blockquote><h4><a name = "tag_001_014_2332">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_2333">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="stty.html">stty</a></i>,
<i><a href="tabs.html">tabs</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
